package com.ruoyi.project.outpatient.service.impl;

import com.ruoyi.project.outpatient.domain.Register;
import com.ruoyi.project.outpatient.domain.RegisterType;
import com.ruoyi.project.outpatient.mapper.RegisterMapper;
import com.ruoyi.project.outpatient.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegisterServiceImpl implements RegisterService {

    @Autowired
    private RegisterMapper registerMapper;

    @Override
    public List<RegisterType> selectRegisterType() {
        return registerMapper.selectRegisterType();
    }

    @Override
    public List<Register> selectRegisterInfo(Register register) {
        return registerMapper.selectRegisterInfo(register);
    }

    @Override
    public Integer insertRegister(Register register) {
        return registerMapper.insertRegister(register);
    }

    @Override
    public List<Register> selectRegiDeInfo(Register register) {
        return registerMapper.selectRegiDeInfo(register);
    }

    @Override
    public Register selectReCostInfo(String registerId) {
        return registerMapper.selectReCostInfo(registerId);
    }

    @Override
    public Integer updateReCostInfo(Register register) {
        register.setTurnoverId( (int) (Math.random() * 1000000000));
        return registerMapper.updateReCostInfo(register);
    }


}
